<script lang="ts" setup>
import { useRoute, RouterView } from 'vue-router';
import { computed } from 'vue';
import LayoutNormal from '@/home/layouts/normal.vue';
import { useAppStore } from '@/home/stores/app';
import AppProvider from './components/AppProvider.vue';

const route = useRoute();
const appStore = useAppStore();

const layout = computed(() => {
  if (route.meta.layout) {
    return route.meta.layout;
  }
  else {
    return LayoutNormal;
  }
});
</script>

<template>
  <AppProvider>
    <img :src="appStore.config.headLogo" :alt="appStore.config.name" class="block h-0 w-0">
    <Component :is="layout">
      <RouterView />
    </Component>
  </AppProvider>
</template>

<style lang="scss" scoped>
</style>
